/*************************************************
* Title：TinyToolKit
* Author：Opportunity 
* Discribe：定义资源加载的基类
* CreateTime：2020-04-05 21:40:00
* Version：1.0
* Modify Recoder：
*************************************************/
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Object = UnityEngine.Object;

namespace TinyToolKit.AssetLoad
{
    public abstract class ResLoaderBase
    {
        //存储加载的缓存资源
        protected Dictionary<string, ResItem> assetsCache;
        public Dictionary<string, ResItem> allAssets => assetsCache;

        public abstract ResItem LoadAsset(string resPath);
        public abstract ResItem LoadAsset<T>(string resPath) where T : UnityEngine.Object; 
        public abstract void LoadAssetsAsync(string resPath, Type resType = null, Action<ResItem> callBack = null);
          
        public abstract ResItem LoadAllAssets(string resPath); 
        public abstract ResItem LoadAllAssets<T>(string resPath) where T : UnityEngine.Object;

        public abstract void UnloadUnusedAssets();
        public abstract void Clear();
    }

    public class ResItem   
    {
        public Object[] objs = null;
    }
}
